package com.fjnu.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.fjnu.dao.IUserDao;
import com.fjnu.dao.impl.UserDao;
import com.fjnu.entities.User;
import com.fjnu.service.IUserService;
@Service("userService")
@Transactional(propagation=Propagation.REQUIRED)
public class UserService implements IUserService {
	@Autowired
	private IUserDao userDao;
	public User loginFindUnique(String idnumber) {
		
		return userDao.loginFindUnique(idnumber);
	}
	
	public List<User> findUser(Integer pageNo, Integer pageSize) {
		
		return userDao.findUser(pageNo, pageSize);
	}

	public void UpdateUser(Integer id, String name, String password) {
		UpdateUser(id, name, password);
		
	}
	public void delUser(Integer id) {
		userDao.delUser(id);
		
	}

	@Override
	public User findUserUnique(int id) {
		
		return userDao.findUserUnique(id);
	}

	public void updateUser(User user) {
		userDao.updateUser(user);
		
	}

	@Override
	public void saveUser(User user) {
		userDao.saveUser(user);
		
	}

}
